import { readdir, readFile, writeFile } from 'fs';
readdir('./', (err, files) => {
  files.forEach(f => {
    readFile('./' + f, 'utf-8', (err, data) => {
      const lastData = data
      data = data.replace(/fill="#.{6}"/, 'fill="var(--svg-fill-color)"')
      if (data !== lastData) {
        writeFile('./' + f, data, {
          'encoding': 'utf-8'
        }, (err) => {
          if(err) console.log(f, err);
        })
      }
    })
  })
})